<template>
	<view class="bg">
		<view class="bg__content" :style="'display:'+isShow+';'">
			<view class="bg__content__first">
				<view class="bg__content__first__image">
					<image :src="data.image_url" mode="heightFix"></image>
					<!-- <image src="../../static/person-p-INTP.png" mode="heightFix"></image> -->
				</view>
				<view class="bg__content__first__text">
					<view class="bg__content__first__text__head">
						<view class="bg__content__first__text__head__left">{{data.name}}</view>
						<view class="bg__content__first__text__head__right">{{data.renge}}</view>
					</view>
					<view class="bg__content__first__text__foot">
						{{data.jdjs}}
					</view>
				</view>
			</view>
			<view class="bg__content__second">
				<view class="bg__content__title">
					<view class="bg__content__title__num">
						01
					</view>
					<view class="bg__content__title__text">
						这四个字母代表什么
					</view>
					
				</view>
				<block v-for="(item,index) in data.zihanyi" :key="index">
				<view class="bg__content__second__text">
					<view class="bg__content__second__text__name" :style="'background-color:'+item.color">{{item.en}}{{item.name}}</view>
					<view class="bg__content__second__text__value">{{item.value}}</view>
				</view>
				</block>
			</view>
			<view class="bg__content__third">
				<view class="bg__content__title">
					<view class="bg__content__title__num">
						02
					</view>
					<view class="bg__content__title__text">
						性格倾向
					</view>
					
				</view>
				<view class="bg__content__text">
					性格倾向性示意图呈现的是测试者四个性格维度两个方向的倾向程度，其分值由问卷答题标准分值综合运算而成。
				</view>
				<block v-for="(item,index) in data.rs" :key="index">
				<view class="bg__content__third__nr">
					<block v-if="item.name == item.win">
						<view class="bg__content__third__nr__1" :style="'color:'+item.color">
							<view>{{item.zh_name.name}}({{item.name}})</view>
							<view>{{item.bfb[0]}}%</view>
						</view>
					</block>
					<block v-else>
						<view class="bg__content__third__nr__1" >
							<view>{{item.zh_name.name}}({{item.name}})</view>
							<view>{{item.bfb[1]}}%</view>
						</view>
					</block>
					<view class="bg__content__third__nr__2">
						
						<block v-if="item.name == item.win">
							<view class="bg__content__third__nr__2__progress">
								<view class="bg__content__third__nr__2__progress__bar" :style="'width:'+item.bfb[0]+'%;background-color:'+item.color">
								</view>
							</view>
						</block>
						<block v-else>
							<view class="bg__content__third__nr__2__progress" :style="'justify-content:flex-end;'">
								<view class="bg__content__third__nr__2__progress__bar" :style="'justify-content:flex-start;width:'+item.bfb[0]+'%;background-color:'+item.color">
								</view>
							</view>
						</block>
						
						
					</view>
					<block v-if="item.name2 == item.win">
						<view class="bg__content__third__nr__3" :style="'color:'+item.color">
							<view>{{item.zh_name2.name}}({{item.name2}})</view>
							<view>{{item.bfb[0]}}%</view>
						</view>
					</block>
					<block v-else>
						<view class="bg__content__third__nr__3">
							<view>{{item.zh_name2.name}}({{item.name2}})</view>
							<view>{{item.bfb[1]}}%</view>
						</view>
						
					</block>
					
				</view>
				</block>
				
				
			</view>
			<view class="bg__content__fourth">
				<view class="bg__content__title">
					<view class="bg__content__title__num">
						03
					</view>
					<view class="bg__content__title__text">
						性格分析
					</view>
					
				</view>
				<view class="bg__content__text">
					<rich-text :nodes="data.renge2"></rich-text>
				</view>
				<view class="bg__content__smallTitle">
					<view class="bg__content__smallTitle__num"></view>
					<view class="bg__content__smallTitle__text">
						性格优点
					</view>
					
				</view>
				<view class="bg__content__text">
					<rich-text :nodes="data.xgyd2"></rich-text>
				</view>
		
				<view class="bg__content__smallTitle">
					<view class="bg__content__smallTitle__num"></view>
					<view class="bg__content__smallTitle__text">
						性格缺点
					</view>
					
				</view>
				<view class="bg__content__text">
					<rich-text :nodes="data.xgqd2"></rich-text>
				</view>
			</view>
			
			
			<view class="bg__content__fourth">
				
				<view class="bg__content__title">
					<view class="bg__content__title__num">
						04
					</view>
					<view class="bg__content__title__text">
						职业发展分析
					</view>
					
				</view>
				<view class="bg__content__smallTitle">
					<view class="bg__content__smallTitle__num"></view>
					<view class="bg__content__smallTitle__text">
						适合领域
					</view>
				</view>
				<view class="bg__content__text">
					<rich-text :nodes="data.shly2"></rich-text>
				</view>
				<view class="bg__content__smallTitle">
					<view class="bg__content__smallTitle__num"></view>
					<view class="bg__content__smallTitle__text">
						适合职业
					</view>
				</view>
				<view class="bg__content__text">
					<rich-text :nodes="data.shzy2"></rich-text>
				</view>
				<view class="bg__content__smallTitle">
					<view class="bg__content__smallTitle__num"></view>
					<view class="bg__content__smallTitle__text">
						工作中的优势
					</view>
				</view>
				<view class="bg__content__text">
					<rich-text :nodes="data.gzzdys2"></rich-text>
				</view>
				<view class="bg__content__smallTitle">
					<view class="bg__content__smallTitle__num"></view>
					<view class="bg__content__smallTitle__text">
						工作中的劣势
					</view>
				</view>
				<view class="bg__content__text">
					<rich-text :nodes="data.gzzdls2"></rich-text>
				</view>
				<view class="bg__content__smallTitle">
					<view class="bg__content__smallTitle__num"></view>
					<view class="bg__content__smallTitle__text">
						就业指导
					</view>
				</view>
				<view class="bg__content__text">
					<rich-text :nodes="data.jyzd2"></rich-text>
				</view>
				<view class="bg__content__title">
					<view class="bg__content__title__num">
						05
					</view>
					<view class="bg__content__title__text">
						个人发展建议
					</view>
					
				</view>
				
				<view class="bg__content__text">
					<rich-text :nodes="data.grfzjy2"></rich-text>
				</view>
			</view>
			
			
			
		</view>
		<view style="height:20rpx;"></view>
	</view>
</template>

<script>
	import unils from "../../unils/utils.js"
	import config from "../../common/config.js"
	export default {
		data() {
			return {
				windowHeight:600,
				data:"",
				isShow:'none',
			}
		},
		onLoad(option) {
			var systemInfo = uni.getSystemInfoSync();
			this.windowHeight = systemInfo.windowHeight;	
			console.log(option.result);
			this.submit(option.result);
			
		},
		methods: {
			
			
			
			
			submit:function(result){
				
				var that = this;
				uni.showLoading({
					title: '加载中'
				});
				var params = {rs:result};
				that.$http('xgcs.submit', params).then(res => {
					if(res.code == 1){
						that.data = res.data;
						that.isShow = 'block';
						uni.hideLoading();
						// console.log(that.data.image_url);
						// console.log(res.data.rs[0].win);
					} else if(res.code == 99){
						// console.log('ddddddddddddd');
						
					} else {
					}
				});
			},
		}
	}
</script>

<style lang="scss">
	@import "css/result2.scss";
</style>
